home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIDNSService.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  7KB  |  173 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIDNSService.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIDNSService_h__
  6. #define __gen_nsIDNSService_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsICancelable; /* forward declaration */
  18.  
  19. class nsIEventTarget; /* forward declaration */
  20.  
  21. class nsIDNSRecord; /* forward declaration */
  22.  
  23. class nsIDNSListener; /* forward declaration */
  24.  
  25.  
  26. /* starting interface:    nsIDNSService */
  27. #define NS_IDNSSERVICE_IID_STR "5c8ec09d-bfbf-4eaf-8a36-0d84b5c8f35b"
  28.  
  29. #define NS_IDNSSERVICE_IID \
  30.   {0x5c8ec09d, 0xbfbf, 0x4eaf, \
  31.     { 0x8a, 0x36, 0x0d, 0x84, 0xb5, 0xc8, 0xf3, 0x5b }}
  32.  
  33. /**
  34.  * nsIDNSService
  35.  */
  36. class NS_NO_VTABLE nsIDNSService : public nsISupports {
  37.  public: 
  38.  
  39.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDNSSERVICE_IID)
  40.  
  41.   /**
  42.      * kicks off an asynchronous host lookup.
  43.      *
  44.      * @param aHostName
  45.      *        the hostname or IP-address-literal to resolve.
  46.      * @param aFlags
  47.      *        a bitwise OR of the RESOLVE_ prefixed constants defined below.
  48.      * @param aListener
  49.      *        the listener to be notified when the result is available.
  50.      * @param aListenerEventTarget
  51.      *        optional parameter (may be null).  if non-null, this parameter
  52.      *        specifies the nsIEventTarget of the thread on which the listener's
  53.      *        onLookupComplete should be called.  however, if this parameter is
  54.      *        null, then onLookupComplete will be called on an unspecified
  55.      *        thread (possibly recursively).
  56.      *
  57.      * @return An object that can be used to cancel the host lookup.
  58.      */
  59.   /* nsICancelable asyncResolve (in AUTF8String aHostName, in unsigned long aFlags, in nsIDNSListener aListener, in nsIEventTarget aListenerEventTarget); */
  60.   NS_IMETHOD AsyncResolve(const nsACString & aHostName, PRUint32 aFlags, nsIDNSListener *aListener, nsIEventTarget *aListenerEventTarget, nsICancelable **_retval) = 0;
  61.  
  62.   /**
  63.      * called to synchronously resolve a hostname.  warning this method may
  64.      * block the calling thread for a long period of time.  it is extremely
  65.      * unwise to call this function on the UI thread of an application.
  66.      *
  67.      * @param aHostName
  68.      *        the hostname or IP-address-literal to resolve.
  69.      * @param aFlags
  70.      *        a bitwise OR of the RESOLVE_ prefixed constants defined below.
  71.      *
  72.      * @return DNS record corresponding to the given hostname.
  73.      * @throws NS_ERROR_UNKNOWN_HOST if host could not be resolved.
  74.      */
  75.   /* nsIDNSRecord resolve (in AUTF8String aHostName, in unsigned long aFlags); */
  76.   NS_IMETHOD Resolve(const nsACString & aHostName, PRUint32 aFlags, nsIDNSRecord **_retval) = 0;
  77.  
  78.   /**
  79.      * @return the hostname of the operating system.
  80.      */
  81.   /* readonly attribute AUTF8String myHostName; */
  82.   NS_IMETHOD GetMyHostName(nsACString & aMyHostName) = 0;
  83.  
  84.   /*************************************************************************
  85.      * Listed below are the various flags that may be OR'd together to form
  86.      * the aFlags parameter passed to asyncResolve() and resolve().
  87.      */
  88. /**
  89.      * if set, this flag suppresses the internal DNS lookup cache.
  90.      */
  91.   enum { RESOLVE_BYPASS_CACHE = 1U };
  92.  
  93.   /**
  94.      * if set, the canonical name of the specified host will be queried.
  95.      */
  96.   enum { RESOLVE_CANONICAL_NAME = 2U };
  97.  
  98. };
  99.  
  100. /* Use this macro when declaring classes that implement this interface. */
  101. #define NS_DECL_NSIDNSSERVICE \
  102.   NS_IMETHOD AsyncResolve(const nsACString & aHostName, PRUint32 aFlags, nsIDNSListener *aListener, nsIEventTarget *aListenerEventTarget, nsICancelable **_retval); \
  103.   NS_IMETHOD Resolve(const nsACString & aHostName, PRUint32 aFlags, nsIDNSRecord **_retval); \
  104.   NS_IMETHOD GetMyHostName(nsACString & aMyHostName); \
  105.  
  106. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  107. #define NS_FORWARD_NSIDNSSERVICE(_to) \
  108.   NS_IMETHOD AsyncResolve(const nsACString & aHostName, PRUint32 aFlags, nsIDNSListener *aListener, nsIEventTarget *aListenerEventTarget, nsICancelable **_retval) { return _to AsyncResolve(aHostName, aFlags, aListener, aListenerEventTarget, _retval); } \
  109.   NS_IMETHOD Resolve(const nsACString & aHostName, PRUint32 aFlags, nsIDNSRecord **_retval) { return _to Resolve(aHostName, aFlags, _retval); } \
  110.   NS_IMETHOD GetMyHostName(nsACString & aMyHostName) { return _to GetMyHostName(aMyHostName); } \
  111.  
  112. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  113. #define NS_FORWARD_SAFE_NSIDNSSERVICE(_to) \
  114.   NS_IMETHOD AsyncResolve(const nsACString & aHostName, PRUint32 aFlags, nsIDNSListener *aListener, nsIEventTarget *aListenerEventTarget, nsICancelable **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->AsyncResolve(aHostName, aFlags, aListener, aListenerEventTarget, _retval); } \
  115.   NS_IMETHOD Resolve(const nsACString & aHostName, PRUint32 aFlags, nsIDNSRecord **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Resolve(aHostName, aFlags, _retval); } \
  116.   NS_IMETHOD GetMyHostName(nsACString & aMyHostName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMyHostName(aMyHostName); } \
  117.  
  118. #if 0
  119. /* Use the code below as a template for the implementation class for this interface. */
  120.  
  121. /* Header file */
  122. class nsDNSService : public nsIDNSService
  123. {
  124. public:
  125.   NS_DECL_ISUPPORTS
  126.   NS_DECL_NSIDNSSERVICE
  127.  
  128.   nsDNSService();
  129.  
  130. private:
  131.   ~nsDNSService();
  132.  
  133. protected:
  134.   /* additional members */
  135. };
  136.  
  137. /* Implementation file */
  138. NS_IMPL_ISUPPORTS1(nsDNSService, nsIDNSService)
  139.  
  140. nsDNSService::nsDNSService()
  141. {
  142.   /* member initializers and constructor code */
  143. }
  144.  
  145. nsDNSService::~nsDNSService()
  146. {
  147.   /* destructor code */
  148. }
  149.  
  150. /* nsICancelable asyncResolve (in AUTF8String aHostName, in unsigned long aFlags, in nsIDNSListener aListener, in nsIEventTarget aListenerEventTarget); */
  151. NS_IMETHODIMP nsDNSService::AsyncResolve(const nsACString & aHostName, PRUint32 aFlags, nsIDNSListener *aListener, nsIEventTarget *aListenerEventTarget, nsICancelable **_retval)
  152. {
  153.     return NS_ERROR_NOT_IMPLEMENTED;
  154. }
  155.  
  156. /* nsIDNSRecord resolve (in AUTF8String aHostName, in unsigned long aFlags); */
  157. NS_IMETHODIMP nsDNSService::Resolve(const nsACString & aHostName, PRUint32 aFlags, nsIDNSRecord **_retval)
  158. {
  159.     return NS_ERROR_NOT_IMPLEMENTED;
  160. }
  161.  
  162. /* readonly attribute AUTF8String myHostName; */
  163. NS_IMETHODIMP nsDNSService::GetMyHostName(nsACString & aMyHostName)
  164. {
  165.     return NS_ERROR_NOT_IMPLEMENTED;
  166. }
  167.  
  168. /* End of implementation class template. */
  169. #endif
  170.  
  171.  
  172. #endif /* __gen_nsIDNSService_h__ */
  173.